<%@page import="Logic.Authorizer"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%
	if (session.getAttribute("name") == null) {
		response.sendRedirect("login.jsp");
	} else {
		if (Authorizer.checkRole("1", session.getAttribute("role")
				.toString()) || Authorizer.checkRole("3", session.getAttribute("role").toString()) || (session
						.getAttribute("role").equals("2"))) {

		}
		else
		{
			response.sendRedirect("nopermission.jsp");
						
		}
	}
%>


<!-- Declare the first header -->
<jsp:include page="t_header.jsp" />

<!-- Declare Breadcrumbs options -->
<!--  <div class="breadcrumbs_container">
	<article class="breadcrumbs">
		<a href="appttype_viewappt.jsp">Manage Appointment Types</a> 
		<div class="breadcrumb_divider"></div>
		<a class="current">New Appointment Type</a>
	</article>
</div> -->
<jsp:include page="header.html" />
<!-- Declare sidebar -->
<jsp:include page="t_sidebarappointment.jsp" />

<!-- Main Content -->
<section id="main" class="column">
<% 
		if (request.getParameter("error") != null)
		{
			if(request.getParameter("error").equals("1"))
				out.print("<h4 class='alert_error'>Error - Please fill in all fields.</h4>");
			else if (request.getParameter("error").equals("2"))
				out.print("<h4 class='alert_error'>Error - Please choose a different appointment name.</h4>");
			else if (request.getParameter("error").equals("-1"))
				out.print("<h4 class='alert_success'>The appointment has been created successfully.</h4>");
		}%>
		
		<article class="module width_full">
		<form action="NewAppointment" method="POST">
			<header><h3>Create New Appointment</h3></header>
				<div class="module_content">
						<fieldset>
							<label>Appointment Name</label>
							<input type="text" maxlength="70" name="apt_name">
						</fieldset>
						<fieldset>
							<label>Roles and Responsibilities</label>
							<textarea name="apt_responsibility" rows="12"></textarea>
						</fieldset>
				</div>
			<footer>
				<div class="submit_link">
					<input type="submit" value="Create Appointment" class="alt_btn">
				</div>
			</footer>
			</form>
		</article><!-- end of post new article -->
		<div class="spacer"></div>
	</section>

<!-- Declare closing tags -->
<jsp:include page="t_footer.jsp"/>